Skip to content

Conversation

@GromNaN
Copy link
Member

@GromNaN GromNaN commented Jan 8, 2026

An issue when using the MakerTestCase to test maker classes provided by other packages, is that it depends on the tests directory of the symfony/maker-bundle package.

In this PR, we use Composer\InstalledVersions::getRootPackage() to retrieve the path and name of the root package under test. This way, that's the tested package that is linked into the temporary test projects.

This assumes a certain structure of the maker package (src, tests and tests/fixtures dirs, tests/tmp ignored, tools/twigcs subproject).

@GromNaN GromNaN added the Feature New Feature label Jan 8, 2026
@GromNaN GromNaN requested a review from jrushlow January 9, 2026 09:31
@GromNaN GromNaN changed the title Make the package name and root dynamically discovered in MakerTestCase Make the root package name and path dynamically discovered in MakerTestCase Jan 9, 2026
}

public function runCommand(string $command): MakerTestProcess
public function runCommand(string|array $command): MakerTestProcess
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a breaking change because the class is internal.

}

public static function create($commandLine, $cwd, array $envVars = [], $timeout = null): self
public static function create(string|array $commandLine, string $cwd, array $envVars = [], ?float $timeout = null): self
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a breaking change because the class is final and internal

}

public function runCommand(string $command): MakerTestProcess
public function runCommand(string|array $command): MakerTestProcess
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest adding a phpdoc @param string|list<string> $command to document the type of the array.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same in MakerTestProcess btw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants